import components from "./components/index";
import {AppLayout, BlankLayout} from "../layouts";
import RouteUtils from "./router.utils";
import AutoMatchingRules from '@/views/bill/BillTurnover/modules/AutoMatchingRules.vue'

const APP_ROUTES = [
  /**  village  */
  {
    name: "village",
    path: "/village",
    component: BlankLayout,
    redirect: (to) => RouteUtils.getRedirectPath(to),
    children: [
      {
        name: "managementCenter",
        path: "managementCenter",
        component: components.ManagementCenter,
        meta: {title: "租控管理", keepAlive: true},
      },
      // 项目管理
      {
        name: "villageList",
        path: "villageList",
        component: components.BuildingProjectList,
        meta: {title: "项目管理", keepAlive: false},
      },
      {
        name: "projectEdit",
        path: "villageEdit",
        component: components.BuildingProjectEdit,
        meta: {
          title: "新增项目",
          keepAlive: false,
          permisson: ["villageList"],
        },
      },
      // 楼宇管理
      {
        name: "buildList",
        path: "buildingList",
        component: components.BuildingList,
        meta: {title: "楼宇管理", keepAlive: false},
      },
      // 租客管理
      {
        name: "ownerList",
        path: "ownerList",
        component: components.OwnerList,
        meta: {title: "租客列表", keepAlive: true},
      },
      {
        name: "ownerDetail",
        path: "ownerDetail",
        component: components.OwnerDetail,
        meta: {title: "租客详情", keepAlive: true},
      },
      {
        name: "OwnerArchives",
        path: "OwnerArchives",
        component: components.OwnerArchives,
        meta: {title: "归档租客列表", keepAlive: false},
      },
      {
        name: "ownerContactsList",
        path: "ownerContactsList",
        component: components.OwnerContact,
        meta: {title: "租客联系人", keepAlive: true},
      },
      // 房源管理
      {
        name: "sectionalDrawing",
        path: "sectionalDrawing",
        component: components.SectionDrawing,
        meta: {title: "剖面图", keepAlive: false},
      },
      {
        name: "houseResources",
        path: "houseResources",
        component: components.HouseResource,
        meta: {title: "房源管理", keepAlive: false},
      },
      // 招商
      {
        name: "customerManagement",
        path: "customerList",
        component: components.CustomerList,
        meta: {title: "意向客户", keepAlive: true},
      },
      {
        name: "importCustomer",
        path: "importCustomer",
        component: components.ImportCustomer,
        meta: {title: "导入意向客户", keepAlive: false},
      },
      // 招商专员
      {
        name: "teamManagement",
        path: "teamManagement",
        component: components.teamManagement,
        meta: {title: "招商专员", keepAlive: false},
      },
      // 渠道
      {
        name: "channelManagement",
        path: "channelManagement",
        component: components.ChannelManagemnt,
        meta: {title: "渠道管理", keepAlive: true},
      },
      // 线索管理
      {
        name: "newClueManagement",
        path: "newClueManagement",
        component: components.ClueManagement,
        meta: {title: "线索管理", keepAlive: true},
      },
      // 导入线索
      {
        name: "importClue",
        path: "importClue",
        component: components.ImportClue,
        meta: {title: "线索管理", keepAlive: true},
      },

      // 招商分析
      {
        name: "attractAnalysis",
        path: "attractAnalysis",
        component: components.InvestmentAnalysis,
        meta: {title: "招商分析", keepAlive: true},
      },
      {
        name: "attractConfig",
        path: "attractConfig",
        component: components.AttractConfig,
        meta: {title: "招商配置", keepAlive: true},
      },
      {
        name: "commissionList",
        path: "commissionList",
        component: components.CommissionManage,
        meta: {title: "佣金规则", keepAlive: true},
      },
      {
        name: "productLibrary",
        path: "productLibrary",
        component: components.ProductLibrary,
        meta: {title: "商品库", keepAlive: true},
      },
      {
        name: "tagManagement",
        path: "tagManagement",
        component: components.tagManagement,
        meta: {title: "基础信息", keepAlive: true},
      },

      // 房源
      {
        name: "houseManagement",
        path: "houseManagement",
        component: components.HouseResourceList,
        meta: {title: "房源管理", keepAlive: true},
      },
      // 租客员工
      {
        name: "ownerUser",
        path: "ownerUser",
        component: components.HouseholdManagement,
        meta: {title: "租客员工管理", keepAlive: true},
      },
      {
        name: "villageUserSummary",
        path: "villageUserSummary",
        component: components.villageUserSummary,
        meta: {title: "人员信息汇总", keepAlive: true},
      },
      // 信息字段管理
      {
        name: "villageExtendField",
        path: "villageExtendField",
        component: components.PersonManage,
        meta: {title: "信息字段管理", keepAlive: true},
      },
      // 供应商列表
      {
        name: "supplierList",
        path: "supplierList",
        component: components.SupplierList,
        meta: {title: "供应商列表", keepAlive: true},
      },
      // 集合列表
      {
        name: "CollectBuildList",
        path: "CollectBuildList",
        component: components.BuildingBuckets,
        meta: {title: "集合列表", keepAlive: true},
      },
      // 线索池
      {
        name: "clueManagement",
        path: "clueManagement",
        // component: components.CluePool,
        // 性的线索列表
        component: components.ClueManagement,
        meta: {title: "线索池", keepAlive: true},
      },
      // 招商获客
      {
        name: "attractingCustomers",
        path: "attractingCustomers",
        component: components.AttractingCustomers,
        meta: {title: "招商获客", keepAlive: true},
      },
      // Ai线索池
      {
        name: "AiClues",
        path: "aiClues",
        component: components.AiClues,
        meta: {title: "线索池", keepAlive: false},
      },
      // ic卡管理
      {
        name: "ICCardList",
        path: "ICCardList",
        component: components.ICCardList,
        meta: {title: "IC卡管理", keepAlive: false},
      },
      // 招商计划
      {
        name: "businessPLan",
        path: "businessPLan",
        component: components.AttractPlan,
        meta: {title: "销售计划", keepAlive: false},
      },
      // 招商装修
      // {
      //   name: "InvestmentDecoration",
      //   path: "InvestmentDecoration",
      //   component: components.InvestmentDecoration,
      //   meta: { title: "招商中心装修", keepAlive: false },
      // },
      // 招商装修 新
      {
        name: "InvestmentDecoration",
        path: "InvestmentDecoration",
        component: components.InvestmentDecorationNew,
        meta: {title: "招商中心装修新", keepAlive: false},
      },
      {
        name: "homeOverview",
        path: "overview",
        component: () => import("@/views/home/index.vue"),
        meta: {title: "数据总览", keepAlive: false},
      },
      {
        name: "selectHousing",
        path: "selectHousing",
        component: () => import("@/components/SelectHousing/index.vue"),
        meta: {title: "选择房源", keepAlive: false},
      },
    ],
  },
  /*   drawing  */
  {
    name: "drawing",
    path: "/drawing",
    component: BlankLayout,
    redirect: (to) => RouteUtils.getRedirectPath(to),
    children: [
      {
        name: "PropertyManagement",
        path: "property",
        component: components.PropertyManagement,
        meta: {title: "剖面图", keepAlive: false},
      },
    ],
  },
  /**  contract  */
  {
    name: "contract",
    path: "/contract",
    component: BlankLayout,
    redirect: (to) => getRedirectPath(to),
    children: [
      {
        name: "contractList",
        path: "contractList",
        component: components.ContractList,
        meta: {title: "合同列表", keepAlive: true},
      },
      {
        name: "costContract",
        path: "costContract",
        component: components.CostContract,
        meta: {title: "成本合同", keepAlive: true},
      },
      {
        name: "electronContractList",
        path: "electronContractList",
        component: components.ElectronContractList,
        meta: {title: "电子合同", keepAlive: true},
      },
      {
        name: "contractFile",
        path: "contractFile",
        component: components.ContractFile,
        meta: {title: "合同归档", keepAlive: true},
      },
      {
        name: "contractDraft",
        path: "contractDraft",
        component: components.DraftContract,
        meta: {title: "草稿合同", keepAlive: true},
      },
      {
        name: "addContract",
        path: "addContract",
        component: components.NewContract,
        meta: {
          title: "编辑合同",
          keepAlive: false,
          permisson: ["contractList", "contractFile", "contractDraft"],
        },
      },
      {
        name: "addContracts",
        path: "addContracts",
        component: components.NewContracts,
        meta: {
          title: "批量生成合同",
          keepAlive: false,
          permisson: ["contractList", "contractFile", "contractDraft"],
        },
      },
      {
        name: "contractDetail",
        path: "contractDetail",
        component: components.ContractDetail,
        meta: {
          title: "合同详情",
          keepAlive: false,
          permisson: ["contractList", "contractFile", "contractDraft"],
        },
      },
      {
        name: "contractApproval",
        path: "contractApproval",
        component: components.ContractApproval,
        meta: {
          title: "合同审批",
          keepAlive: false,
          permisson: ["contractList", "contractFile", "contractDraft"],
        },
      },
      {
        name: "contractApprovalList",
        path: "contractApprovalList",
        component: components.ContractApprovalList,
        meta: {
          title: "合同审批列表",
          keepAlive: true,
          permisson: ["contractList", "contractFile", "contractDraft"],
        },
      },
      {
        name: "contractTemplateList",
        path: "contractTemplateList",
        component: components.ContractTemplate,
        meta: {
          title: "合同配置模板",
          keepAlive: false,
        },
      },
      {
        name: "newContractTemplate",
        path: "newContractTemplate",
        component: components.NewContractTemplate,
        meta: {
          title: "编辑合同配置模板",
          keepAlive: false,
          permisson: ["contractTemplateList"],
        },
      },
      {
        name: "processContract",
        path: "approvalProcess",
        component: components.ContractApprovalProcess,
        meta: {title: "合同审核流程", keepAlive: true},
      },
      {
        name: "contractClause",
        path: "clauseType",
        component: components.ContractClauseType,
        meta: {title: "合同条款类型", keepAlive: true},
      },
      {
        name: "contractExpireRule",
        path: "expireRule",
        component: components.ContractExpireRule,
        meta: {title: "合同到期提醒", keepAlive: true},
      },
      {
        name: "divideRemindList",
        path: "divideRemindList",
        component: components.DivideRemindList,
        meta: {title: "分成合同录入提醒", keepAlive: true},
      },
      {
        name: "contractPrintList",
        path: "printTemplate",
        component: components.ContractPrintTemplate,
        meta: {title: "合同打印模板", keepAlive: true},
      },
      {
        name: "retreatContractList",
        path: "retreatAgreement",
        component: components.ContractRetreatAgreement,
        meta: {title: "合同退租协议", keepAlive: true},
      },
      {
        name: "purposeContractList",
        path: "purposeContractList",
        component: components.PurposeContractList,
        meta: {title: "意向合同", keepAlive: true},
      },
      {
        name: "contractDiscount",
        path: "discountContractList",
        component: components.DiscountContractList,
        meta: {title: "优惠合同", keepAlive: true},
      },
      {
        name: "contractRetreat",
        path: "contractRetreat",
        component: components.ContractRetreat,
        meta: {title: "退租合同", keepAlive: true},
      },
      {
        name: "contractCarryOver",
        path: "contractCarryOver",
        component: components.NewCarryOver,
        meta: {title: "合同结转", keepAlive: false},
      },
    ],
  },
  /**  bill  */
  {
    name: "bill",
    path: "/bill",
    component: BlankLayout,
    redirect: (to) => getRedirectPath(to),
    children: [
      {
        name: "billList",
        path: "billList",
        component: components.AllBills,
        meta: {title: "所有账单", keepAlive: true},
      },
      {
        name: "newIncomeBill",
        path: "newIncomeBill",
        component: components.NewIncomeBill,
        meta: {
          title: "添加收款账单",
          keepAlive: false,
          permisson: ["billList"],
        },
      },
      {
        name: "newPaymentBill",
        path: "newPaymentBill",
        component: components.NewPaymentBill,
        meta: {
          title: "添加付款账单",
          keepAlive: false,
          permisson: ["billList"],
        },
      },
      {
        name: "billDetail",
        path: "billDetail",
        component: components.BillDetail,
        meta: {title: "账单详情", keepAlive: false, permisson: ["billList"]},
      },
      {
        name: "streamList",
        path: "streamList",
        component: components.BillTurnover,
        meta: {title: "收支流水", keepAlive: true},
      },
      {
        name: "newTurnover",
        path: "newTurnover",
        component: components.NewTurnover,
        meta: {
          title: "添加收支流水",
          keepAlive: false,
          permisson: ["streamList"],
        },
      },
      {
        name: "importBillFlow",
        path: "importBillFlow",
        component: components.ImportBillFlow,
        meta: {
          title: "导入收支流水",
          keepAlive: false,
          permisson: ["streamList"],
        },
      },
      {
        name: "billFlowImportRecord",
        path: "billFlowImportRecord",
        component: components.BillFlowImportRecord,
        meta: {
          title: "导入流水记录",
          keepAlive: true,
          permisson: ["streamList"],
        },
      },
      {
        name: "turnoverDetail",
        path: "turnoverDetail",
        component: components.TurnoverDetail,
        meta: {
          title: "收支流水详情",
          keepAlive: false,
          permisson: ["streamList"],
        },
      },
      {
        name: "matchingRules",
        path: "matchingRules",
        component: components.AutoMatchingRules,
        meta: {
          title: "自动匹配规则",
          keepAlive: false,
          permisson: ["streamList"],
        },
      },
      {
        name: "incomeList",
        path: "incomeList",
        component: components.IncomeList,
        meta: {title: "收入列表", keepAlive: true},
      },
      {
        name: "incomeDetail",
        path: "incomeDetail",
        component: components.IncomeDetail,
        meta: {title: "收入列表详情", keepAlive: false},
      },
      {
        name: "addRetreat",
        path: "addRetreat",
        component: components.NewRetreat,
        meta: {title: "退租协议", keepAlive: false},
      },
      {
        name: "makeInvoice",
        path: "makeInvoice",
        component: components.MakeInvoice,
        meta: {title: "生成开票信息", keepAlive: false},
      },
      {
        name: "receipt",
        path: "receipt",
        component: components.NewReceipt,
        meta: {title: "新建收据", keepAlive: false},
      },
      {
        name: "receiptList",
        path: "receiptList",
        component: components.NewReceiptList,
        meta: {title: "收据记录", keepAlive: true},
      },
      {
        name: "reportList",
        path: "reportList",
        component: components.BillStatement,
        meta: {title: "财务报表", keepAlive: false},
      },
      {
        name: "receiptDetail",
        path: "receiptDetail",
        component: components.ReceiptEdit,
        meta: {title: "收据详情", keepAlive: false},
      },
      {
        name: "retreatReportList",
        path: "retreatReportList",
        component: components.RetreatReport,
        meta: {title: "退房报表", keepAlive: true},
      },
      {
        name: "billCashierList",
        path: "billCashierList",
        component: components.CashierDesk,
        meta: {title: "收银台", keepAlive: true},
      },
      {
        name: "invoiceList",
        path: "invoiceList",
        component: components.InvoiceRecord,
        meta: {title: "开票记录", keepAlive: true},
      },
      {
        name: "invoiceDetail",
        path: "invoiceDetail",
        component: components.InvoiceDetail,
        meta: {title: "开票详情", keepAlive: false},
      },
      {
        name: "billNotice",
        path: "billNotice",
        component: components.NoticeList,
        meta: {title: "收款通知", keepAlive: false},
      },
      {
        name: "waitingNoticeList",
        path: "waitingNoticeList",
        component: components.WaitingNoticeList,
        meta: {title: "待发通知单", keepAlive: false},
      },
      {
        name: "OwnerPreStore",
        path: "OwnerPreStore",
        component: components.OwnerPreStore,
        meta: {title: "租客预存", keepAlive: false},
      },
      {
        name: "noticeSetting",
        path: "noticeSetting",
        component: components.PaymentNoticeSetting,
        meta: {title: "通知单设置", keepAlive: true},
      },
      {
        name: "InvoiceSetting",
        path: "invoiceSetting",
        component: components.InvoiceSetting,
        meta: {title: "发票设置", keepAlive: true},
      },
      {
        name: "receiptSetting",
        path: "receiptSetting",
        component: components.ReceiptSetting,
        meta: {title: "收据管理", keepAlive: true},
      },
      {
        name: "specialCost",
        path: "specialCost",
        component: components.FeeTypeSetting,
        meta: {title: "费用类型设置", keepAlive: true},
      },
      {
        name: "couponManagement",
        path: "couponManagement",
        component: components.CouponManagement,
        meta: {title: "优惠券管理", keepAlive: false},
      },
      // 收费标准
      {
        name: "standardList",
        path: "standardList",
        component: components.ChargeStandards,
        meta: {title: "收费标准", keepAlive: true},
      },
      {
        name: "overdueBillList",
        path: "overdueBillList",
        component: components.OverdueBillList,
        meta: {title: "逾期账单", keepAlive: true},
      },
    ],
  },
  /**  setting  */
  {
    name: "company",
    path: "/company",
    component: BlankLayout,
    redirect: (to) => RouteUtils.getRedirectPath(to),
    children: [
      {
        name: "companyBasicInfo",
        path: "basicInfo",
        component: components.CompanyBasicSetting,
        meta: {title: "企业基本信息", keepAlive: true},
      },
      {
        name: "orgBranchList",
        path: "orgBranchList",
        component: components.CompanyInfo,
        meta: {title: "公司列表", keepAlive: true},
      },
      {
        name: "manageAccount",
        path: "account",
        component: components.CompanyAccountSetting,
        meta: {title: "收支账户配置", keepAlive: true},
      },
      {
        name: "companyPayList",
        path: "payment",
        component: components.PaymentSetting,
        meta: {title: "支付配置", keepAlive: true},
      },
      {
        name: "taglibVillage",
        path: "tag/village",
        component: components.VillageTag,
        meta: {title: "项目标签", keepAlive: true},
      },
      {
        name: "taglibBuild",
        path: "tag/build",
        component: components.BuildTag,
        meta: {title: "楼宇标签", keepAlive: true},
      },
      {
        name: "taglibHouse",
        path: "tag/room",
        component: components.RoomTag,
        meta: {title: "房源标签", keepAlive: true},
      },
      {
        name: "taglibOwner",
        path: "tag/owner",
        component: components.OwnerTag,
        meta: {title: "租客标签", keepAlive: true},
      },
      {
        name: "taglibContract",
        path: "tag/contract",
        component: components.ContractTag,
        meta: {title: "合同标签", keepAlive: true},
      },
      {
        name: "taglibIndustry",
        path: "tag/industry",
        component: components.IndustryTag,
        meta: {title: "行业分类", keepAlive: true},
      },
      {
        name: "taglibTermination",
        path: "tag/retreatReason",
        component: components.RetreatTag,
        meta: {title: "退租原因", keepAlive: true},
      },
      // 成员/部门
      {
        name: "companyDepartmentUser",
        path: "departmentUser",
        component: components.DepartmentUser,
        meta: {title: "成员部门管理", keepAlive: true},
      },
      // 角色管理
      {
        name: "companyRoles",
        path: "roles",
        component: components.CompanyRoles,
        meta: {title: "角色管理", keepAlive: true},
      },
      // 申请列表
      {
        name: "memberApplyList",
        path: "memberApplyList",
        component: components.MemberApplyList,
        meta: {title: "成员申请列表", keepAlive: false},
      },
      // 排班组设置
      {
        name: "companyShiftGroup",
        path: "shiftGroup",
        component: components.ShiftGroupManage,
        meta: {title: "排班组设置", keepAlive: false},
      },
      // 添加排班组
      {
        name: "addCompanyShiftGroup",
        path: "addShiftGroup",
        component: components.AddShiftGroup,
        meta: {title: "新建排班组", keepAlive: false},
      },
      // 排班设置
      {
        name: "companyShift",
        path: "shift",
        component: components.ShiftManage,
        meta: {title: "班次设置", keepAlive: false},
      },
      // 排班
      {
        name: "ShiftArrange",
        path: "shiftArrange",
        component: components.ShiftArrange,
        meta: {title: "排班管理", keepAlive: false},
      },
    ],
  },
  /**  个人设置  */
  {
    name: "personal",
    path: "/personal",
    component: BlankLayout,
    redirect: (to) => RouteUtils.getRedirectPath(to),
    children: [
      {
        name: "personalInfo",
        path: "info",
        component: components.PersonalSetting,
        meta: {title: "个人设置", keepAlive: true},
      },
    ],
  },
  /** 工作台 */
  {
    name: "overview",
    path: "/overview",
    component: BlankLayout,
    redirect: (to) => RouteUtils.getRedirectPath(to),
    children: [
      {
        name: "homeOverviewProject",
        path: "project",
        component: components.homeOverviewProject,
        meta: {title: "项目概况", keepAlive: true},
      },
      {
        name: "homeOverviewProperty",
        path: "property",
        component: components.homeOverviewProperty,
        meta: {title: "资产评估", keepAlive: true},
      },
      {
        name: "homeOverviewRoom",
        path: "room",
        component: components.homeOverviewRoom,
        meta: {title: "资源分析", keepAlive: true},
      },
      {
        name: "homeLeaseOverview",
        path: "lease",
        component: components.homeLeaseOverview,
        meta: {title: "租赁分析", keepAlive: true},
      },
      {
        name: "homeOwnerOverview",
        path: "owner",
        component: components.homeOwnerOverview,
        meta: {title: "租客分析", keepAlive: true},
      },
    ],
  },
   /*   customer 商品库 */
   {
    name: "customer",
    path: "/customer",
    component: BlankLayout,
    redirect: (to) => RouteUtils.getRedirectPath(to),
    children: [
      {
        name: "customerBrand",
        path: "customerBrand",
        component: components.CustomerBrand,
        meta: {title: "品牌库", keepAlive: false},
      },
      {
        name: "selectBrandIndex",
        path: "selectBrandIndex",
        component: components.SelectBrandIndex,
        meta: { title: "选择品牌列表", keepAlive: false },
      },
    ],
  },
];

export default APP_ROUTES;
